<html>
<head><meta charset="utf-8"><title>impl IntoIterator&lt;Item = &amp;&#x27;a (impl AsRawFd + &#x27;a)&gt; · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html">impl IntoIterator&lt;Item = &amp;&#x27;a (impl AsRawFd + &#x27;a)&gt;</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="206365882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206365882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206365882">(Aug 08 2020 at 22:03)</a>:</h4>
<p>I'm trying to figure out a compiler error I don't fully understand.</p>



<a name="206365892"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206365892" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206365892">(Aug 08 2020 at 22:04)</a>:</h4>
<p>I first wrote this:</p>
<div class="codehilite"><pre><span></span><code><span class="w">    </span><span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">connect</span><span class="p">(</span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="n">sockets</span>: <span class="nc">impl</span><span class="w"> </span><span class="nb">IntoIterator</span><span class="o">&lt;</span><span class="n">Item</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="k">impl</span><span class="w"> </span><span class="n">AsRawFd</span><span class="o">&gt;</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">anyhow</span>::<span class="nb">Result</span><span class="o">&lt;</span><span class="kt">u32</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
</code></pre></div>



<a name="206365936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206365936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206365936">(Aug 08 2020 at 22:04)</a>:</h4>
<p>That gave me this error:</p>
<div class="codehilite"><pre><span></span><code>error[E0310]: the parameter type `impl AsRawFd` may not live long enough
   --&gt; src/lib.rs:117:58
    |
117 |     pub fn connect(&amp;mut self, sockets: impl IntoIterator&lt;Item = &amp;impl AsRawFd&gt;) -&gt; anyhow::Result&lt;u32&gt; {
    |                                                          ^^^^^^^^------------
    |                                                          |       |
    |                                                          |       help: consider adding an explicit lifetime bound...: `impl AsRawFd + &#39;static`
    |                                                          ...so that the reference type `&amp;&#39;static impl AsRawFd` does not outlive the data it points at
</code></pre></div>



<a name="206365940"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206365940" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206365940">(Aug 08 2020 at 22:04)</a>:</h4>
<p>I got a similar error if I tried to use <code>'_</code>.</p>



<a name="206365952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206365952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206365952">(Aug 08 2020 at 22:05)</a>:</h4>
<p>So, I wrote this:</p>
<div class="codehilite"><pre><span></span><code><span class="w">    </span><span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">connect</span><span class="o">&lt;</span><span class="na">&#39;a</span><span class="o">&gt;</span><span class="p">(</span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="n">sockets</span>: <span class="nc">impl</span><span class="w"> </span><span class="nb">IntoIterator</span><span class="o">&lt;</span><span class="n">Item</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="na">&#39;a</span><span class="w"> </span><span class="k">impl</span><span class="w"> </span><span class="n">AsRawFd</span><span class="o">&gt;</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">anyhow</span>::<span class="nb">Result</span><span class="o">&lt;</span><span class="kt">u32</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
</code></pre></div>



<a name="206365956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206365956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206365956">(Aug 08 2020 at 22:05)</a>:</h4>
<p>Which gave me <em>two</em> of this error:</p>
<div class="codehilite"><pre><span></span><code>error[E0309]: the parameter type `impl AsRawFd` may not live long enough
   --&gt; src/lib.rs:117:62
    |
117 |     pub fn connect&lt;&#39;a&gt;(&amp;mut self, sockets: impl IntoIterator&lt;Item = &amp;&#39;a impl AsRawFd&gt;) -&gt; anyhow::Result&lt;u32&gt; {
    |                                                              ^^^^^^^^^^^------------
    |                                                              |          |
    |                                                              |          help: consider adding an explicit lifetime bound...: `impl AsRawFd + &#39;a`
    |                                                              ...so that the reference type `&amp;&#39;a impl AsRawFd` does not outlive the data it points at
</code></pre></div>



<a name="206365958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206365958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206365958">(Aug 08 2020 at 22:05)</a>:</h4>
<p>I finally had to write this:</p>
<div class="codehilite"><pre><span></span><code><span class="w">    </span><span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">connect</span><span class="o">&lt;</span><span class="na">&#39;a</span><span class="o">&gt;</span><span class="p">(</span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="n">sockets</span>: <span class="nc">impl</span><span class="w"> </span><span class="nb">IntoIterator</span><span class="o">&lt;</span><span class="n">Item</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="na">&#39;a</span><span class="w"> </span><span class="p">(</span><span class="k">impl</span><span class="w"> </span><span class="n">AsRawFd</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="na">&#39;a</span><span class="p">)</span><span class="o">&gt;</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">anyhow</span>::<span class="nb">Result</span><span class="o">&lt;</span><span class="kt">u32</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
</code></pre></div>



<a name="206365959"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206365959" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206365959">(Aug 08 2020 at 22:06)</a>:</h4>
<p>And I don't understand why.</p>



<a name="206366008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206366008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206366008">(Aug 08 2020 at 22:07)</a>:</h4>
<p>I'd appreciate some help understanding this interesting corner of references and lifetimes.</p>



<a name="206366962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206366962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206366962">(Aug 08 2020 at 22:32)</a>:</h4>
<p>I think it might be helpful to desugar the <code>impl</code>s to understand this, like this (for the original snippet, no idea why it defaults to <code>'static</code>):</p>
<div class="codehilite"><pre><span></span><code>    pub fn connect&lt;I&gt;(&amp;mut self, sockets: I) -&gt; anyhow::Result&lt;u32&gt;
    where I: IntoIterator, &amp;&#39;static I::Item: AsRawFd
</code></pre></div>



<a name="206366982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206366982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206366982">(Aug 08 2020 at 22:33)</a>:</h4>
<p><code>'static</code> is fairly clearly wrong. :)</p>



<a name="206366998"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206366998" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206366998">(Aug 08 2020 at 22:33)</a>:</h4>
<p>I'm just not understanding why the <code>+ 'a</code> would be required, and for that matter why the lifetime needs specifying explicitly at all.</p>



<a name="206367133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206367133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206367133">(Aug 08 2020 at 22:36)</a>:</h4>
<p>I recall there being a papercut issue filled about this – IIRC the conclusion was that although in this particular setting the lifetimes could be inferred from each other, this in particular is only such special case/situation.</p>



<a name="206367239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206367239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206367239">(Aug 08 2020 at 22:39)</a>:</h4>
<p>That is in <code>&amp;'a Bound: Trait + 'a</code> the latter lifetime is superfluous as they both say the same thing.</p>



<a name="206367289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206367289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206367289">(Aug 08 2020 at 22:40)</a>:</h4>
<p>OK then, I'm now less confused. :)</p>



<a name="206367298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206367298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206367298">(Aug 08 2020 at 22:40)</a>:</h4>
<p>I was assuming this had some meaning I didn't understand, rather than being redundant.</p>



<a name="206367300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206367300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206367300">(Aug 08 2020 at 22:40)</a>:</h4>
<p>I guess someobody might want to have something like <code>'b: 'a, &amp;'a Bound: Trait + 'b</code> in some extremely rare case?</p>



<a name="206367301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206367301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206367301">(Aug 08 2020 at 22:40)</a>:</h4>
<p>Thanks for the explanation. :)</p>



<a name="206367315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206367315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206367315">(Aug 08 2020 at 22:41)</a>:</h4>
<p>(I can't easily imagine a scenario where that'd be useful, but sure, you <em>could</em> do that. You just shouldn't have to write it out in the normal case.)</p>



<a name="206367507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206367507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> teor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206367507">(Aug 08 2020 at 22:46)</a>:</h4>
<p>A 'static trait bound would also work here, but it might be a stronger bound than you need:<br>
<a href="https://doc.rust-lang.org/rust-by-example/scope/lifetime/static_lifetime.html#trait-bound">https://doc.rust-lang.org/rust-by-example/scope/lifetime/static_lifetime.html#trait-bound</a></p>



<a name="206367582"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206367582" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206367582">(Aug 08 2020 at 22:48)</a>:</h4>
<p>The actual argument a caller would pass in will not have a static lifetime.</p>



<a name="206368004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206368004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> teor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206368004">(Aug 08 2020 at 23:02)</a>:</h4>
<p>Maybe I'm confused here:<br>
"As a trait bound, 'static means the type does not contain any non-static references."</p>
<p>For example, an owned RawFd value would meet the AsRawFd + 'static bound.</p>



<a name="206368740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206368740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206368740">(Aug 08 2020 at 23:28)</a>:</h4>
<p>That seems like an unnecessary restriction to impose on the caller.</p>



<a name="206368748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206368748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206368748">(Aug 08 2020 at 23:29)</a>:</h4>
<p>One could imagine something like <code>Buffered&lt;'a, File&gt;</code> implementing <code>AsRawFd</code> but not <code>'static</code>.</p>



<a name="206369332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/impl%20IntoIterator%3CItem%20%3D%20%26%27a%20%28impl%20AsRawFd%20%2B%20%27a%29%3E/near/206369332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> teor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/impl.20IntoIterator.3CItem.20.3D.20.26&#x27;a.20(impl.20AsRawFd.20.2B.20&#x27;a).3E.html#206369332">(Aug 08 2020 at 23:47)</a>:</h4>
<blockquote>
<p>it might be a stronger bound than you need:</p>
</blockquote>
<p>I think we're agreeing here.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>